d6d97c
@@ -1248,7 +1248,14 @@
public abstract class ProcessorDefinition<Type extends ProcessorDefinition<Type>
      * @return the builder
      */
     public ChoiceDefinition endChoice() {
-        ProcessorDefinition<?> def = end();
+        // are we already a choice?
+        ProcessorDefinition<?> def = this;
+        if (def instanceof ChoiceDefinition) {
+            return (ChoiceDefinition) def;
+        }
+
+        // okay end this and get back to the choice
+        def = end();
         if (def instanceof WhenDefinition) {
             return (ChoiceDefinition) def.getParent();
         } else if (def instanceof OtherwiseDefinition) {
